Add nosort suboption.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 3 Sep 2003 19:32:28 +0000 (19:32 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 3 Sep 2003 19:32:28 +0000 (19:32 +0000)
gpsbabel/position.c

index 36b69aa3c99a92f61e59ed3a9e8055a660f38d7b..56eb7ec5d4619cdebb084013f07d3ff91f69bd0f 100644 (file)
@@ -33,6 +33,7 @@ static char *distopt;
 static char *latopt;
 static char *lonopt;
 static char *exclopt;
+static char *nosort;
 
 waypoint * home_pos;
 
@@ -57,6 +58,8 @@ arglist_t radius_args[] = {
                ARGTYPE_FLOAT | ARGTYPE_REQUIRED },
        {"exclude", &exclopt,  "Exclude points close to center",
                ARGTYPE_BOOL },
+       {"nosort", &nosort,    "Inhibit sort by distance to center.",
+               ARGTYPE_BOOL },
        {0, 0, 0, 0}
 };
 
@@ -233,7 +236,9 @@ radius_process(void)
                i++;
        }
 
-       qsort(comp, wc, sizeof(waypoint *), dist_comp);
+       if (!nosort) {
+               qsort(comp, wc, sizeof(waypoint *), dist_comp);
+       }
 
        /*
         * The comp array is now sorted by distance.   As we run through it,